<?php
//if (isset($_SESSION['username'])) {
include_once 'header.php';
require_once("conn.php");
$year = $_GET['year'];
$month = $_GET['month'];
$age = $_GET['age'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>乐知家园</title>
        <script language="javascript">
            function deleteproduct(id,packid,name){
                var str = "\u786e定删除 " + name + "\uff1f";
                if(confirm(str)){
                    location.href = "deleteProduct.php?id=" + id + "&packid=" + packid;
                }
            }
        </script>
        <style type="text/css">
            <!--
            body,td,th {
                font-family: 微软雅黑;
                font-size: 14px;
                color: #000000;
            }
            -->
        </style></head>

    <body>
        <br/>
        <table width="80%" border="0" align="center" cellpadding="2" cellspacing="2" bordercolor="#FFFFFF" bgcolor="#669999">
            <tr>
                <td> <b><?php echo $year; ?>年 <?php echo $month; ?>月 <?php echo $age; ?>岁</b>
                </td>
            </tr>
        </table>
        <br/>
        <table width="80%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#9999FF">
            <tr align="center" height="20">
                <td bgcolor="#666666">编号</td>
                <td bgcolor="#666666">套名</td>
                <td bgcolor="#666666">时间</td>
                <td bgcolor="#666666">操作</td>
            </tr>
            <?php
            $db = new DBC();
            $sql = "SELECT * FROM t_pack WHERE year = " . $year . " AND month = " . $month . " AND age = " . $age;
            $data = $db->fetchData($sql);
            foreach ($data as $pack) {
                ?>
                <tr height="20">
                    <td width="20%" bgcolor="#FFFFFF">&nbsp;<?php echo $pack['packcode']; ?></td>
                    <td width="30%" bgcolor="#FFFFFF">&nbsp;<?php echo $pack['name']; ?></td>
                    <td width="30%" bgcolor="#FFFFFF">&nbsp;<?php echo $pack['createTime']; ?></td>
                    <td width="20%" align="center" bgcolor="#FFFFFF"><a href="packEdit.php?packid=<?php echo $pack['packid']; ?>&menu=pack">编辑</a></td>                        
                </tr>
            <?php } ?>                    
        </table>              
    </body>
</html>
<?php
include_once 'footer.php';
//} else {
//    header("login.php");
//}
?>